package com.pubinfo.passbook.common.model.ruler;

import com.pubinfo.passbook.common.model.http.response.GetWriteoffBaseData.WriteoffBaseDataItem;
import com.pubinfo.passbook.common.model.http.response.GetWriteoffBaseData.WriteoffBaseDataOrgAndRole;
import lombok.Data;

@Data
public class UserAcc {
  /*报账人姓名*/
  private String name;
  /*报账人账号*/
  private String account;
  /*报账组织信息*/
  private String orgCode;
  /**
   * 报账组织名称
   */
  private String orgName;
  
  public UserAcc() {
    
  }
  
  public UserAcc(WriteoffBaseDataItem writeoffBaseDataItem, WriteoffBaseDataOrgAndRole orgAndRole) {
    this.name = writeoffBaseDataItem.getPrincipalName();
    this.account = writeoffBaseDataItem.getPrincipalAccount();
    this.orgCode = orgAndRole.getOrgCode();
    this.orgName = orgAndRole.getOrgName();
  }
  
  public UserAcc(WriteoffBaseDataItem writeoffBaseDataItem) {
    this.name = writeoffBaseDataItem.getPrincipalName();
    this.account = writeoffBaseDataItem.getPrincipalAccount();
    this.orgCode = writeoffBaseDataItem.getWriteoffBaseDataOrgAndRoles().get(0).getOrgCode();
    
  }
}
